package entity;

import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.LazyToOne;

@Entity
@Table(name = "Platos")
@Embeddable
public class PlatoBD {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer idPlato;
	
	private String descripcion;
	private Float porcComision;
	
	@Embedded
	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "idReceta")
	private RecetaBD receta;

	@Embedded
	@OneToOne
	@JoinColumn(name = "idArea")
	private AreaBD area;
	private Float precio;

	public PlatoBD() {
	}

	public Integer getIdPlato() {
		return idPlato;
	}

	public void setIdPlato(Integer idPlato) {
		this.idPlato = idPlato;
	}

	public Float getPorcComision() {
		return porcComision;
	}

	public void setPorcComision(Float porcComision) {
		this.porcComision = porcComision;
	}

	public RecetaBD getReceta() {
		return receta;
	}

	public void setReceta(RecetaBD receta) {
		this.receta = receta;
	}

	public void setArea(AreaBD area) {
		this.area = area;
	}

	public AreaBD getArea() {
		return area;
	}

	public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public void setPrecio(Float precio) {
		this.precio = precio;
	}

	public Float getPrecio() {
		return precio;
	}

}
